#!/usr/bin/make -f
# -*- makefile -*-

# StaffLog Terminal - Predesys client
# Version: 0.1
# Authors: Jose A. Jimenez <jajimc@gmail.com>, Miguel Centeno <miguelcent@gmail.com>
# License: GPL 3.0 (see "license" file)

NAME				= stafflog-terminal

DESTDIR				= ""
DEST_MAINDIR		= $(DESTDIR)/usr/share/$(NAME)
DEST_BIN			= $(DESTDIR)/usr/bin
DEST_PIXMAPS		= $(DESTDIR)/usr/share/pixmaps
DEST_APP			= $(DESTDIR)/usr/share/applications

SRC_MAINDIR			= src
SRC_ABOUTFILE		= about
SRC_LICENSEFILE		= license

compile:

install:	basic-install

basic-install:
	# Directories creation
	mkdir -p $(DEST_MAINDIR) $(DEST_BIN) $(DEST_PIXMAPS) $(DEST_APP)
	
	# Program files installation
	install -p -m 0644 $(SRC_MAINDIR)/*.py $(DEST_MAINDIR)
	install -p -m 0644 $(SRC_MAINDIR)/*.glade $(DEST_MAINDIR)
	install -p -m 0644 $(SRC_MAINDIR)/*.xml $(DEST_MAINDIR)
	install -p -m 0644 $(SRC_MAINDIR)/*.png $(DEST_MAINDIR)
	install -p -m 0644 $(SRC_ABOUTFILE) $(DEST_MAINDIR)
	install -p -m 0644 $(SRC_LICENSEFILE) $(DEST_MAINDIR)
	
	install -p -m 0644 $(SRC_MAINDIR)/stafflog-setup $(DEST_BIN)
	install -p -m 0644 $(SRC_MAINDIR)/stafflog-terminal $(DEST_BIN)
	install -p -m 0644 $(SRC_MAINDIR)/stafflog-setup.png $(DEST_PIXMAPS)
	install -p -m 0644 $(SRC_MAINDIR)/stafflog-terminal.png $(DEST_PIXMAPS)
	install -p -m 0644 $(SRC_MAINDIR)/stafflog-setup.desktop $(DEST_APP)
	install -p -m 0644 $(SRC_MAINDIR)/stafflog-terminal.desktop $(DEST_APP)
	
uninstall:
	# Program files deletion
	rm $(DEST_BIN)/stafflog-setup
	rm $(DEST_BIN)/stafflog-terminal
	rm $(DEST_PIXMAPS)/stafflog-setup.png
	rm $(DEST_PIXMAPS)/stafflog-terminal.png
	rm $(DEST_APP)/stafflog-setup.desktop
	rm $(DEST_APP)/stafflog-terminal.desktop		
	rm -rf $(DEST_MAINDIR)
